﻿// -----------------------------------------------------------------------
// <copyright file="BoolToSelectionModeConverter.cs" company="">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Brjnk.GpxExplorer.WPF
{
    using System;
    using System.Windows.Controls;
    using System.Windows.Data;

    /// <summary>
    /// Převede hodnotu true na SelectionMode.Multiple
    /// </summary>
    public class BoolToMultipleSelectionModeConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value == null) return SelectionMode.Extended;
            if ((bool)value) return SelectionMode.Multiple;
            return SelectionMode.Extended;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}